<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Laravel</title>

        <!-- Fonts -->
  <link rel="stylesheet" href="{{ admin_asset("/vendor/laravel-admin/AdminLTE/bootstrap/css/bootstrap.min.css") }}">
        <!-- <link rel="stylesheet" href="{{ admin_asset("/vendor/laravel-admin/jquery-tags-input/src/jquery.tagsinput.css") }}" type="text/css"> -->
        <link rel="stylesheet" href="{{ admin_asset("/vendor/laravel-admin/bootstrap-tagsinput/dist/bootstrap-tagsinput.css") }}" type="text/css">


        <script src="{{ admin_asset("/vendor/laravel-admin/AdminLTE/plugins/jQuery/jQuery-2.1.4.min.js")}} "></script>
        <script src="{{ admin_asset("/vendor/laravel-admin/AdminLTE/bootstrap/js/bootstrap.min.js")}}"></script>

        <script src="{{ admin_asset("/vendor/laravel-admin/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js")}} "></script>

        <!-- Styles -->
        <style>
            html, body {
                background-color: #fff;
                color: #636b6f;
                font-family: 'Nunito', sans-serif;
                font-weight: 200;
                height: 100vh;
                margin: 0;
            }

            .full-height {
                height: 100vh;
            }

            .flex-center {
                align-items: center;
                display: flex;
                justify-content: center;
            }

            .position-ref {
                position: relative;
            }

            .top-right {
                position: absolute;
                right: 10px;
                top: 18px;
            }

            .content {
                text-align: center;
            }

            .title {
                font-size: 84px;
            }

            .links > a {
                color: #636b6f;
                padding: 0 25px;
                font-size: 13px;
                font-weight: 600;
                letter-spacing: .1rem;
                text-decoration: none;
                text-transform: uppercase;
            }

            .m-b-md {
                margin-bottom: 30px;
            }
            ul .suggested_tag {
                display: inline-block;
                padding: 0 3px 3px 0;
                margin: 0;
                width: auto;
            }
            ul .suggested_tag a {
                font-size: 12px;
                display: block;
                color: #0099e5;
                -webkit-border-radius: 3px;
                border-radius: 3px;
                border: 1px solid #0099e5;
                padding: 5px;
                -webkit-transition: all .2s;
                -moz-transition: all .2s;
                transition: all .2s;
            }
        </style>
    </head>
    <body>
        <div class="flex-center position-ref full-height">
            <div class="content">
                <div class="title m-b-md">
                </div>
                <form>
                    <input id="ss" type="text" />
                    <!-- <input type="text" value="Amsterdam,Washington" data-role="tagsinput" /> -->
                </form>
                <ul class="suggested_tags">
                    
                </ul>
            </div>
        </div>
    </body>
    <script type="text/javascript">
        // $("input[data-role='tagsinput']").tagsInput('items');
        // $('input[data-role="tagsinput"]').tagsInput({
        //       source: function(query) {
        //         return $.getJSON('citynames.json');
        //       }
        // });
        // $("input").tagsinput('items');
    var html = '<li class="suggested_tag"><a href="javascript:void(0)" title="人">人</a></li>';
        $(".suggested_tags").append(html);
        // $('.suggested_tag').on('click', function () {

        //     $('input').tagsinput({
        //       source: ['Amsterdam', '2222', 'Sydney', 'Beijing', 'Cairo']
        //     });
        //     $(".suggested_tags").append(html);
        // });

     // $('#ss').tagsinput();
     // $("#ss").val('dddd,sss,ggg');

    // $('input').tagsinput({
    //   source: ['Amsterdam', '2222', 'Sydney', 'Beijing', 'Cairo']
    // });
    // 
    // $('input').tagsinput({
    //   itemText: 'label'
    // });
    // $('input').tagsinput({
    //   itemText: function(item) {
    //     return item.label;
    //   }
    // });
    // $('input').tagsinput({
    //   itemText: 'label'
    // });

    $("#ss").tagsinput({
            itemValue: 'id',
            itemText: 'text',
        });

    var test={id:'adfa',text:'fff'};
    $("#ss").tagsinput('add', test);
    var test={id:'fff',text:'aaa'};
    $("#ss").tagsinput('add', test);
    console.log($("#ss").val());
    </script>
</html>
